const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  token: state => state.user.token,
  // staffPhoto: state =>state.user.profile? state.user.profile.staffPhoto:state.user.profile,
  // name: state =>state.user.profile? state.user.profile.username:state.user.profile
  // es6中的可选链 ?. 先判断左边的是否位null或undefined，如果是，则不会往下判断，反之
  staffPhoto: state => state.user.profile?.staffPhoto,
  name: state => state.user.profile?.username
}
export default getters
